/**
 * Copyright (c) 2018-2028, HQY 胡庆一 (215218393@qq.com).
 * <p>
 * Licensed under the GNU LESSER GENERAL PUBLIC LICENSE 3.0;
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * <p>
 * http://www.gnu.org/licenses/lgpl.html
 * <p>
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.ocm.warehouse.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.Version;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import lombok.experimental.Accessors;
import com.ocm.core.mp.base.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

/**
 * 实体类
 *
 * @author HQY
 * @since 2021-11-30
 */
@Data
@TableName("ocm_warehouse_stock")
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@ApiModel(value = "Stock对象", description = "Stock对象")
public class Stock extends BaseEntity {

    private static final long serialVersionUID = 1L;

    /**
     * 主键
     */
	@TableId(value = "id", type = IdType.ASSIGN_ID)
	@JsonSerialize(using = ToStringSerializer.class)
    @ApiModelProperty(value = "主键")
    private Long id;
    /**
     * 商品id
     */
	@JsonSerialize(using = ToStringSerializer.class)
    @ApiModelProperty(value = "商品id")
    private Long spuId;
    /**
     * 规格id
     */
	@JsonSerialize(using = ToStringSerializer.class)
    @ApiModelProperty(value = "规格id")
    private Long skuId;
    /**
     * 库存数量
     */
	@JsonSerialize(using = ToStringSerializer.class)
    @ApiModelProperty(value = "库存数量")
    private Long stockNumber;

	@JsonSerialize(using = ToStringSerializer.class)
	@ApiModelProperty(value = "待发数量")
	private Long stockLock;

	private String saleAttr;

    /**
     * 乐观锁
     */
    @ApiModelProperty(value = "乐观锁")
	@Version
    private Long version;
    /**
     * 仓库id
     */
	@JsonSerialize(using = ToStringSerializer.class)
    @ApiModelProperty(value = "仓库id")
    private Long warehouseId;


}
